package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

@Setter
@Getter
public class CourseOrder {
    //录入时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;
    //潜在客户,查id
    private Customer customer;
    //数据字典,查学科id
    private SystemDictionaryItem course;
    //销售金额
    private BigDecimal money;
    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("money",money);
        map.put("inputTime",inputTime);
        if(customer!=null){
            map.put("customerId",customer.getId());
        }
        if(course!=null){
            map.put("courseId",course.getId());
        }
        return JSON.toJSONString(map);

    }



}